package com.ztz.musicappdemo;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by wqewqe on 2017/4/11.
 */

public class MyDbHelper extends SQLiteOpenHelper {
    public static final String CREATE_USERINFO="create table UserInfo("
            +"id integer primary key autoincrement,"
            +"userName text,"
            +"password text,"
            +"phone text,"
            +"sex text,"
            +"content text)";
    private Context context;
    public MyDbHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
        this.context=context;
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(CREATE_USERINFO);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        db.equals("drop table if exists UserInfo ");
    }
}
